﻿using System.Collections.Generic;
using FluentNH_DO.Entities;

namespace FluentNH_DO.Contract
{
    public interface IContact
    {
        /// <summary>
        /// Get Contact by Id
        /// </summary>
        /// <param name="id">Id of the Contact</param>
        /// <returns>Contact object</returns>
        Contact GetContactById(int id);

        /// <summary>
        /// List of all Contacts
        /// </summary>
        /// <returns>List of Contacts</returns>
        IList<Contact> GetContacts();

        /// <summary>
        /// Get List of Contacts that matches a name
        /// </summary>
        /// <param name="name">Name to match</param>
        /// <returns>List of Contacts</returns>
        IList<Contact> GetContactByName(string name);

        /// <summary>
        /// Get List of Contact information about for a Contact
        /// </summary>
        /// <param name="contact">Contact</param>
        /// <returns>List of ContactInfo</returns>
        IList<ContactInfo> GetContactInfo(Contact contact);

        /// <summary>
        /// Get a ContactInfoType by Id
        /// </summary>
        /// <param name="id">Id of the ContactInfoType</param>
        /// <returns></returns>
        ContactInfoType GetContactInfoTypeById(int id);
        
        /// <summary>
        /// Get list of all ContactInfoTypes
        /// </summary>
        /// <returns>List of ContactInfoTypes</returns>
        IList<ContactInfoType> GetContactInfoTypes();

        /// <summary>
        /// Add Contact
        /// </summary>
        /// <param name="contact">Contact</param>
        /// <returns>Id of new contact</returns>
        int AddContact(Contact contact);

        //TODO: Check if this methood should have Contact as a parameter
        //      to know which user the info belong too.
        /// <summary>
        /// Add ContactInfo
        /// </summary>
        /// <param name="info">ContactInfo</param>
        /// <returns>Id of new ContactInfo</returns>
        int AddInfo(ContactInfo info);

        /// <summary>
        /// Add ContactInfoType
        /// </summary>
        /// <param name="type">ContactInfoType</param>
        /// <returns>Id of new ContactInfoType</returns>
        int AddType(ContactInfoType type);

        /// <summary>
        /// Delete a Contact
        /// </summary>
        /// <param name="contact">Contact</param>
        void DeleteContact(Contact contact);

        /// <summary>
        /// Delete a ContactInfo
        /// </summary>
        /// <param name="info">ContactInfo</param>
        void DeleteInfo(ContactInfo info);

        /// <summary>
        /// Delete a ContactInfoType
        /// </summary>
        /// <param name="type">ContactInfoType</param>
        void DeleteType(ContactInfoType type);

    }
}
